package br.com.simora.crawler;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.log4j.Logger;

import br.com.simora.http.RecuperadorInformacoes;

public class TransamericaFM implements Runnable {
	private static Logger logger = Logger.getLogger(RadioCidadeFMCrawler.class);
	private static String URL = "http://transanet.telium.com.br/radio.php";
	RecuperadorInformacoes info = new RecuperadorInformacoes();

	private void recuperaInfo() throws Exception{
		String url = URL +  new Date().getTime();
		logger.debug(url);
		info.setUrl(url, "html");
	}
	
	@Override
	public void run() {
		while(true){
			String dataFormatada = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(new Date());
			try {
				recuperaInfo();
			} catch (Exception e1) {
				e1.printStackTrace();
			}
			logger.debug("transamericafm " + dataFormatada);
			try {
				
				Thread.sleep(1000*10*6);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}

}